< previous page page_407 next page >

Page 407
LISTING 18.7.CONTINUED
9f8044bafea36a1f728739c0bb58ef4c.gif
19:     'If repSQLEngine.TransactionState <> TRANSACTION_ROLLBACK Then
20:         m_returns = beginDBTrans
21:         m_pConnection.Execute ms_SQL
22:         m_returns = m_pConnection.RowsAffected
23:         If m_returns >=0 Then
24:            executeSQL = m_returns
25:         End If
26:     'End If
27:     executeSQL = rdoEngine.rdoErrors(0).SQLRetcode
28:     If Switch(executeSQL = 0, True, executeSQL = 1, True) Then
29:         'Operation successful
30:         If theAppTransactions.pTransLogIsOn Then
31:             theAppTransactions.addTrans2Text Processing of SQL was
 successful
32:         End If
33:         commitDBTrans
34:     End If
35:     Exit Function
36: executeSQLErr:
37:     m_returns = rollbackDBTrans
38:     theErrorHandler.handleErrors Err
39:     theErrorHandler.handleDBErrors rdoEngine.rdoErrors, eDBErrors.RDOErr
40:     'theAppTransactions.activateLogging
41: End Function
42: 'Declared in ErrorHandler
43: Public Sub handleDBErrors(argMsg As Byte, _
44: argObject As Object)
45:     handleDaoErrors argMsg, argObject
46:     handleRdoErrors argMsg, argObject
47: End Sub
48: Private Sub handleDaoErrors(argMsg As Byte, _
49: argObject As DAO.Errors)
50:     If argMsg = eDBErrors.DAOErr Then
51:         Dim theDAOError As DAO.Error
52:         For Each theDAOError In argObject
53:             theAppTransactions.addTrans2Text _
54:                 theDAOError.Number & theRDOError.Source _
55:                 & theDAOError.Description
56:         Next
57:         theAppTransactions.addTrans2Text _
58:             Processing of SQL was not successful
59:         theAppTransactions.showLog
60:     End If
61: End Sub
62: Private Sub handleRdoErrors(argMsg As Byte, _
63: argObject As rdoErrors)
64:     If argMsg = eDBErrors.RDOErr Then
65:         Dim theRDOError As rdoError
continues

 
< previous page page_407 next page >

If you like this book, buy it!